home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Getopt::Std.Z / Getopt::Std
Encoding:
Text File  |  1998-10-28  |  2.1 KB  |  67 lines

  1.  
  2.  
  3.  
  4.      GGGGeeeettttoooopppptttt::::::::SSSSttttdddd((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    GGGGeeeettttoooopppptttt::::::::SSSSttttdddd((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       getopt - Process single-character switches with switch
  10.       clustering
  11.  
  12.       getopts - Process single-character switches with switch
  13.       clustering
  14.  
  15.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  16.           use Getopt::Std;
  17.  
  18.           getopt('oDI');    # -o, -D & -I take arg.     Sets opt_* as a side effect.
  19.           getopt('oDI', \%opts);    # -o, -D & -I take arg.     Values    in %opts
  20.           getopts('oif:');    # -o & -i are boolean flags, -f    takes an argument
  21.                 # Sets opt_* as    a side effect.
  22.           getopts('oif:', \%opts);    # options as above. Values in %opts
  23.  
  24.  
  25.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  26.       The _g_e_t_o_p_t() functions processes single-character switches
  27.       with switch clustering.  Pass    one argument which is a    string
  28.       containing all switches that take an argument.  For each
  29.       switch found,    sets $opt_x (where x is    the switch name) to
  30.       the value of the argument, or    1 if no    argument.  Switches
  31.       which    take an    argument don't care whether there is a space
  32.       between the switch and the argument.
  33.  
  34.       Note that, if    your code is running under the recommended use
  35.       strict 'vars'    pragma,    it may be helpful to declare these
  36.       package variables via    use vars perhaps something like    this:
  37.  
  38.           use vars qw/ $opt_foo $opt_bar /;
  39.  
  40.       For those of you who don't like additional variables being
  41.       created, _g_e_t_o_p_t() and    _g_e_t_o_p_t_s() will also accept a hash
  42.       reference as an optional second argument. Hash keys will be
  43.       x (where x is    the switch name) with key values the value of
  44.       the argument or 1 if no argument is specified.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.